package study.async.springboot.service;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

@Slf4j
@Service
public class AsyncService {

    @Async
    public String doAsync(long timeout) {
        ThreadUtil.sleep(timeout, TimeUnit.SECONDS);
        log.info("ssssssssssssssssss");
        return "fasdfsa";
    }
}
